<template>
    <div >
        <div class="leftitem">
            <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
                <el-menu-item :index="item.value " v-for="(item,index)  in menuIndexRightitem" :key="index" style="width: 100%;">
                    {{item.title}}
                </el-menu-item>
            </el-menu>
        </div>
        <div class="rightitem">
            <el-row >
                <dwmanager  ref='dwmanager'></dwmanager> 
            </el-row> 
        </div>
        
    </div>
</template>
<script>
    import {mapActions} from 'vuex';

    export default {
        data: () => ({
            detailsVisible: true,
            activeIndex: '',
            typeA:'',
            showAdd: false,
            menuIndexRightitem: [
                {title:'党组织管理',value:'dwmanager'},
                {title:'工作内容管理',value:'dwmanager2'},
                // {title:'工作内容管理',value:'dwmanager2'},
                // {title:'工作内容管理',value:'dwmanager2'},
                // {title:'工作内容管理',value:'dwmanager2'},
                // {title:'工作内容管理',value:'dwmanager2'},
                // {title:'工作内容管理',value:'dwmanager2'},
                // {title:'工作内容管理',value:'dwmanager2'},
            ],
            //面包屑
            showcomponent:{},

        }),
        components: {
            dwmanager: function (resolve) { require(["./dwmanager.vue"], resolve);},
        },
        mounted() {
            this.$Common.Config.this = this;
            if (this.GetUser() == false) {
                this.$router.push("/");
            }
            if (this.$store.state.user.operation >= 2) {
                this.$message({
                    type: 'info',
                    message: '您没有后台管理权限!'
                });
                setTimeout(()=> {
                    this.$router.push("/"); 
                },1000);
            }
        },
        methods: {
            ...mapActions(['GetUser','Getallgns']),
            handleSelect(value) {
                for( var index in this.$refs){
                    let sss=this.$refs[index]
                    if(sss){
                        sss.$data.dialogVisible = false;
                    }
                }
                this.$refs[value].$data.dialogVisible = true;//[0]
                // setTimeout(()=> {
                //     console.log(this);
                // }, 100);

                // setTimeout(function () {
                //     _this.$refs[this.showcomponent.name].$data.detailsVisible = false;//[0]
                // }, 100)

            },
            

            GetcomponentsNeed()
            {
                
            },


        }
    }
</script>
<style scope>